//
//  PhysicsManager.h
//  CandyJump
//
//  Created by Bon Lam on 16/03/2011.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>

#import "chipmunk.h"

//---------------------------------------------------------------------------------------------------------------------
typedef enum  {
	//  Don't re-order please!
	MODEL_COLLISION_TYPE_UNDEFINED = 0,
	MODEL_COLLISION_TYPE_CHARACTER = 1,
	
	MODEL_COLLISION_TYPE_MAP_COMPONENT = 10,
	MODEL_COLLISION_TYPE_PLATFORM = MODEL_COLLISION_TYPE_MAP_COMPONENT,
	
	MODEL_COLLISION_TYPE_SKILLS = 20,
	
}  MODEL_COLLISION_TYPE;


//	Class for managing physics functions, e.g. collisions callbacks
//=====================================================================================================================
@interface PhysicsManager : NSObject {

}

//---------------------------------------------------------------------------------------------------------------------
#pragma mark PhysicsManager - Singleton
- (id)init;
- (void)dealloc;
+ (id)allocWithZone:(NSZone *)zone;
- (id)copyWithZone:(NSZone *)zone;
- (id)retain;
- (NSUInteger)retainCount;
- (void)release;
- (id)autorelease;

+ (PhysicsManager *)sharedManager;
#pragma mark PhysicsManager - Collision Callbacks
+ (void)setupCollisionCallbacks:(cpSpace *)space;

//	Collision Callbacks
//typedef cpBool (*cpCollisionBeginFunc)(cpArbiter *arb, struct cpSpace *space, void *data);
//typedef cpBool (*cpCollisionPreSolveFunc)(cpArbiter *arb, struct cpSpace *space, void *data);
//typedef void (*cpCollisionPostSolveFunc)(cpArbiter *arb, struct cpSpace *space, void *data);
//typedef void (*cpCollisionSeparateFunc)(cpArbiter *arb, struct cpSpace *space, void *data);

//static cpBool platformCollisionBegan(cpArbiter *arb, cpSpace *space, void *data);

@end
